<div id="<?php print $id_tab; ?>">
<div id="accordion-<?php print $id_tab; ?>" class="accordion">
    <?php if($import_data != null): ?>
    <h3><?php print lang('vt_tkpnhapkho');?></h3>
    <div>
        <table cellpadding="0" cellspacing="0" border="0" class="display dataTable" id="" active_url="">
            <thead>
                <tr>
                    <th class="ui-state-default"><?php print lang('vt_stt'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_billcode'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_nguoinhap'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_nhacungcap'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_total-vat'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_vat%'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_vattotal'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_total+vat'); ?></th>
                </tr>
            </thead>
            <tbody>
                <?php $j = 1; $count_total = 0; $count_totalvat = 0; ?>
                <?php foreach($import_data As $imp): ?>
                <tr class="<?php print ( $j%2 == 0 ) ? 'even':'odd'; ?>">
                    <td><?php print $j; ?></td>
                    <td><?php print $imp[1]; ?></td>
                    <td><?php print $imp[2]; ?></td>
                    <td><?php print $imp[3]; ?></td>
                    <td><?php print formatMoney(decimal_format($imp[4])); ?></td>
                    <td><?php print decimal_format($imp[5]); ?></td>
                    <td><?php print formatMoney(decimal_format($imp[6])); ?></td>
                    <td><?php print formatMoney(decimal_format($imp[7])); ?></td>
                </tr>
                <?php 
                    $j++;
                    $count_total += $imp[4];
                    $count_totalvat += $imp[7];
                ?>
                <?php endforeach; ?>
            </tbody>
            <tfoot>
                <tr>
                    <th colspan="4" align="right" class="ui-state-default"><?php print lang('vt_total-vat'); ?></th>
                    <th class="ui-state-default"><?php print formatMoney(decimal_format($count_total)); ?></th>
                    <th colspan="2" align="right" class="ui-state-default"><?php print lang('vt_total+vat'); ?></th>
                    <th class="ui-state-default"><?php print formatMoney(decimal_format($count_totalvat)); ?></th>
                </tr>
            </tfoot>
        </table>
    </div>
    <?php endif; ?>
    
    <?php if($export_data != null): ?>
    <h3><?php print lang('vt_tkpxuatkho');?></h3>
    <div>
        <table cellpadding="0" cellspacing="0" border="0" class="display dataTable" id="" active_url="">
            <thead>
                <tr>
                    <th class="ui-state-default"><?php print lang('vt_stt'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_billcode'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_nguoinhap'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_nguoinhanphieu'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_total-vat'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_vat%'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_vattotal'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_total+vat'); ?></th>
                </tr>
            </thead>
            <tbody>
                <?php $k = 1; $count_totalex = 0; $count_totalvatex = 0; ?>
                <?php foreach($export_data As $exp): ?>
                <tr class="<?php print ( $k%2 == 0 ) ? 'even':'odd'; ?>">
                    <td><?php print $k; ?></td>
                    <td><?php print $exp[1]; ?></td>
                    <td><?php print $exp[2]; ?></td>
                    <td><?php print $exp[3]; ?></td>
                    <td><?php print formatMoney(decimal_format($exp[4])); ?></td>
                    <td><?php print decimal_format($exp[5]); ?></td>
                    <td><?php print formatMoney(decimal_format($exp[6])); ?></td>
                    <td><?php print formatMoney(decimal_format($exp[7])); ?></td>
                </tr>
                <?php 
                    $k++;
                    $count_totalex += $exp[4];
                    $count_totalvatex += $exp[7];
                ?>
                <?php endforeach; ?>
            </tbody>
            <tfoot>
                <tr>
                    <th colspan="4" align="right" class="ui-state-default">Tong Tien(-VAT):</th>
                    <th class="ui-state-default"><?php print formatMoney(decimal_format($count_totalex)); ?></th>
                    <th colspan="2" align="right" class="ui-state-default">Tong Tien(+VAT):</th>
                    <th class="ui-state-default"><?php print formatMoney(decimal_format($count_totalvatex)); ?></th>
                </tr>
            </tfoot>
        </table>
    </div>
    <?php endif; ?>
    
    <?php if($revert_data != null): ?>
    <h3><?php print lang('vt_tkvttralai');?></h3>
    <div>
        <table cellpadding="0" cellspacing="0" border="0" class="display dataTable" id="" active_url="">
            <thead>
                <tr>
                    <th class="ui-state-default"><?php print lang('vt_stt'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_mavt'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_tenvt'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_soluongtra'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_dongia'); ?></th>
                </tr>
            </thead>
            <tbody>
                <?php $l = 1;?>
                <?php foreach($revert_data As $rev): ?>
                <tr class="<?php print ( $l%2 == 0 ) ? 'even':'odd'; ?>">
                    <td><?php print $l; ?></td>
                    <td><?php print $rev['code']; ?></td>
                    <td><?php print $rev['name']; ?></td>
                    <td><?php print $rev['count']; ?></td>
                    <td><?php print formatMoney(decimal_format($rev['price'])); ?></td>
                </tr>
                <?php $l++;?>
                <?php endforeach; ?>
            </tbody>
        </table>
    </div>
    <?php endif; ?>
    
    <h3><?php print lang('vt_tkdanhsachvt'); ?></h3>
    <div>
        <table cellpadding="0" cellspacing="0" border="0" class="display dataTable" id="" active_url="">
            <thead>
                <tr>
                    <th class="ui-state-default"><?php print lang('vt_stt'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_mavt'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_tenvt'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_donvitinh'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_slbandau'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_slxuat'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_slnhap'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_sltra'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_sltonkho'); ?></th>
                    <th class="ui-state-default"><?php print lang('vt_dongia'); ?></th>
                </tr>
            </thead>
            <tbody style="overflow: auto;height: 500px;">
                <?php $i = 1; ?>
                <?php foreach($data As $row): ?>
                <tr class="<?php print ( $i%2 == 0 ) ? 'even':'odd'; ?>">
                    <td><?php print $i; ?></td>
                    <td><?php print $row['code']; ?></td>
                    <td><?php print $row['name']; ?></td>
                    <td><?php print $row['value']; ?></td>
                    <td><?php print decimal_format($row['first_total']); ?></td>
                    <td><?php print decimal_format($row['export']); ?></td>
                    <td><?php print decimal_format($row['import']); ?></td>
                    <td><?php print decimal_format($row['revert']); ?></td>
                    <td><?php print decimal_format($row['first_total'] - $row['export'] + $row['import'] + $row['revert']); ?></td>
                    <td><?php print formatMoney(decimal_format($row['price'])); ?></td>
                </tr>
                <?php $i++; ?>
                <?php endforeach; ?>
            </tbody>
        </table>
    </div>
</div>
</div>
